package com.shinbada.modules.sys.entity;

import com.google.common.collect.Lists;
import com.shinbada.config.swagger.IgnoreSwaggerParameter;
import com.shinbada.core.persistence.DataEntity;
import com.shinbada.modules.sys.enums.DictGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 数据字典Entity
 *
 * @author initcap
 * @version 2017-01-16
 */
@Data
@ToString
@ApiModel("字典类型实体")
public class DictType extends DataEntity<DictType> {

    private static final long serialVersionUID = 1L;
    @ApiModelProperty("类型")
    private String type;
    @ApiModelProperty("分组")
    @NotNull(message = "分组必须指定，系统级别不可以删除，用户定义可以删除!")
    private DictGroup dictGroup;
    @ApiModelProperty("描述")
    private String description;
    @ApiModelProperty("子列表")
    @IgnoreSwaggerParameter
    private List<DictValue> dictValueList = Lists.newArrayList();

    public DictType() {
        super();
    }

    public DictType(String id) {
        super(id);
    }

}
